/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gm.entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Med EL MOUDDENE
 */
@Entity
@Table(name = "remarque")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Remarque.findAll", query = "SELECT r FROM Remarque r"),
    @NamedQuery(name = "Remarque.findByIdRemarque", query = "SELECT r FROM Remarque r WHERE r.idRemarque = :idRemarque")})
public class Remarque implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_REMARQUE")
    private Integer idRemarque;
    @Lob
    @Size(max = 65535)
    @Column(name = "REMARQUE")
    private String remarque;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "remarque")
    private Collection<SubirExamenRemarque> subirExamenRemarqueCollection;

    public Remarque() {
    }

    public Remarque(Integer idRemarque) {
        this.idRemarque = idRemarque;
    }

    public Integer getIdRemarque() {
        return idRemarque;
    }

    public void setIdRemarque(Integer idRemarque) {
        this.idRemarque = idRemarque;
    }

    public String getRemarque() {
        return remarque;
    }

    public void setRemarque(String remarque) {
        this.remarque = remarque;
    }

    @XmlTransient
    public Collection<SubirExamenRemarque> getSubirExamenRemarqueCollection() {
        return subirExamenRemarqueCollection;
    }

    public void setSubirExamenRemarqueCollection(Collection<SubirExamenRemarque> subirExamenRemarqueCollection) {
        this.subirExamenRemarqueCollection = subirExamenRemarqueCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idRemarque != null ? idRemarque.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Remarque)) {
            return false;
        }
        Remarque other = (Remarque) object;
        if ((this.idRemarque == null && other.idRemarque != null) || (this.idRemarque != null && !this.idRemarque.equals(other.idRemarque))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.gm.entities.Remarque[ idRemarque=" + idRemarque + " ]";
    }
    
}
